package com.qf.service.impl;

import com.qf.dao.ProjectDao;
import com.qf.pojo.Project;
import com.qf.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName ProjectServiceImpl
 * @Description TODO
 * @Author 86181
 * @Date 2022/9/7 12:02
 * @Version 1.0
 **/
@Service
public class ProjectServiceImpl implements ProjectService {
    public ProjectServiceImpl() {
        System.out.println("service初始化了");
    }

    @Autowired
    private ProjectDao projectDao;
    @Transactional
    public List<Project> findAll() {
        List<Project> all = projectDao.findAll();
        return all;
    }

    public int deleteProject(int pid) {
        int i = projectDao.deleteProject(pid);
        return i;
    }

    public boolean addProject(Project project) {
        projectDao.addProject(project);
        return true;
    }


}
